package com.hg.chapter931.message;

import lombok.AllArgsConstructor;
import lombok.Setter;
import org.springframework.jms.core.MessageCreator;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;

//消息定义
@Setter
@AllArgsConstructor
public class Msg implements MessageCreator {

    private String msg;

    @Override
    public Message createMessage(Session session) throws JMSException {
        return session.createTextMessage(msg);
    }
}
